home *** CD-ROM | disk | FTP | other *** search
- head 2.7;
- access ;
- symbols ;
- locks ; strict;
- comment @ * @;
-
-
- 2.7
- date 88.05.15.21.01.24; author douglis; state Exp;
- branches ;
- next 2.6;
-
- 2.6
- date 88.04.07.10.30.46; author douglis; state Exp;
- branches ;
- next 2.5;
-
- 2.5
- date 88.03.17.22.43.04; author douglis; state Exp;
- branches ;
- next 2.4;
-
- 2.4
- date 88.02.21.15.55.03; author douglis; state Exp;
- branches ;
- next 2.3;
-
- 2.3
- date 87.11.20.12.41.29; author douglis; state Exp;
- branches ;
- next 2.2;
-
- 2.2
- date 87.03.15.21.33.50; author douglis; state Exp;
- branches ;
- next 2.1;
-
- 2.1
- date 87.03.11.18.12.46; author douglis; state Exp;
- branches ;
- next 2.0;
-
- 2.0
- date 87.03.11.12.39.57; author douglis; state Exp;
- branches ;
- next ;
-
-
- desc
- @Declarations internal to the loadAvg program.
- @
-
-
- 2.7
- log
- @changed to use the hostInfo C library routines and structures.
- @
- text
- @/*
- * loadAvg.h --
- *
- * Declarations internal to the loadAvg program.
- *
- * Copyright 1987 Regents of the University of California
- * All rights reserved.
- *
- *
- * $Header: loadAvg.h,v 2.6 88/04/07 10:30:46 douglis Exp $ SPRITE (Berkeley)
- */
-
- #ifndef _LOADAVG
- #define _LOADAVG
-
- #include "sprite.h"
- #include "status.h"
- #include "io.h"
- #include "mem.h"
- #include "fs.h"
- #include "proc.h"
- #include "time.h"
- #include "byte.h"
- #include "dataBase.h"
- #include "hostInfo.h"
-
- /*
- * Define pseudo-RPC protocol for named pipes.
- *
- * LA_RPC_UPDATE - update load statistics for a node
- * LA_RPC_IDLE - get an idle node
- * LA_RPC_ALLINFO - output statistics for all nodes
- */
-
- #define LA_RPC_UPDATE 0
- #define LA_RPC_IDLE 1
- #define LA_RPC_ALL_INFO 2
-
- #define LOAD_NUM_VALUES 3
-
- /*
- * Define constants related to Sprite system characteristics and defaults.
- */
-
- #define STANDARD_OUTPUT 1
- #define OPEN_MODE 0664
- #define MAX_NUM_HOSTS 256
-
- /*
- * A record contains "%2d %3d %10d %10d %3.0f %3.0f %3.0f %5.2f %5.2f %5.2f\n",
- * plus a null byte. (This amounts to 54 bytes.) Make it the next
- * power of 2.
- *
- * Note that after this is debugged, this can be changed to write in binary
- * form rather than converting to ASCII.
- */
-
- #define UTIL_RECORD_SIZE 64
-
- /*
- * Subscripts into the queueThreshold array.
- */
- #define MIN_THRESHOLD 0
- #define MAX_THRESHOLD 1
-
- /*
- * Arbitrary value larger than the load average on any node
- */
- #define MAX_LOAD 1000.0
-
-
- /*
- * For each machine, keep track of the timestamp for its information and the
- * different load averages reported. Also, the architecture type
- * (e.g., sun2/sun3/spur) is stored to make sure we can migrate to a machine
- * of the same type.
- */
-
- typedef struct {
- int hostID;
- int archType;
- int utils[LOAD_NUM_VALUES];
- double lengths[LOAD_NUM_VALUES];
- int bootTime;
- int timestamp;
- int noInput;
- Boolean allowMigration;
- } NodeInfo;
-
- /*
- * If we are not allowing foreign processes, but our time since last input
- * is greater than noInput and our average queue lengths are ALL less than
- * the corresponding values in min, start accepting foreign processes.
- *
- * If we are allowing foreign processes and either the idle time drops
- * or ANY of the average queue lengths exceeds its corresponding value in max,
- * stop accepting them.
- */
-
- typedef struct {
- int noInput;
- double min[LOAD_NUM_VALUES];
- double max[LOAD_NUM_VALUES];
- } Thresholds;
-
- /*
- * Global variables. (Options, plus other global vars initialized at startup.)
- */
-
- extern Boolean debug;
- extern Boolean verbose;
- extern int loadInterval;
- extern int writeInterval;
- extern int timeOut;
- extern Boolean forkChild;
- extern Boolean lockFile;
- extern char *dataFile;
- extern char *weightString;
- extern double weights[];
- extern Thresholds thresholds;
-
- extern int hostID;
- extern int archType;
- extern char *myName;
-
- /*
- * Procedures.
- */
-
- extern void RunDaemon();
- extern void RunServer();
- extern ReturnStatus OpenCreate();
-
- #endif _LOADAVG
- @
-
-
- 2.6
- log
- @Removed references to "server" and using pipes, since that's obsolete.
- @
- text
- @d10 1
- a10 1
- * $Header: loadAvg.h,v 2.5 88/03/17 22:43:04 douglis Exp $ SPRITE (Berkeley)
- d24 2
- @
-
-
- 2.5
- log
- @Added byte.h to include list.
- @
- text
- @d10 1
- a10 1
- * $Header: loadAvg.h,v 2.4 88/02/21 15:55:03 douglis Exp $ SPRITE (Berkeley)
- a112 2
- extern Boolean useDataFile;
- extern Boolean usePipes;
- a114 3
- extern char *pipeDir;
- extern char *requestFile;
- extern char *responseFile;
- @
-
-
- 2.4
- log
- @just added myName global variable.
- @
- text
- @d10 1
- a10 1
- * $Header: loadAvg.h,v 2.3 87/11/20 12:41:29 douglis Exp $ SPRITE (Berkeley)
- d23 1
- @
-
-
- 2.3
- log
- @Store the boottime and architecture type in the global file.
- @
- text
- @d10 1
- a10 1
- * $Header: loadAvg.h,v 2.2 87/03/15 21:33:50 douglis Exp $ SPRITE (Berkeley)
- d126 1
- @
-
-
- 2.2
- log
- @Combined thresholds into a single structure. Added getting random node.
- @
- text
- @d10 1
- a10 1
- * $Header: loadAvg.h,v 2.1 87/03/11 18:12:46 douglis Exp $ SPRITE (Berkeley)
- d71 3
- a73 1
- * different load averages reported.
- d78 1
- d81 1
- d125 1
- @
-
-
- 2.1
- log
- @Keep track of whether to migrate processes based on load average
- and keyboard/mouse idle time.
- @
- text
- @d10 1
- a10 1
- * $Header: proto.h,v 1.7 87/01/04 17:28:51 andrew Exp $ SPRITE (Berkeley)
- a35 9
- /*
- * Define constants specific to load average statistics.
- */
-
- #define LOAD_INTERVAL 5
- #define WRITE_INTERVAL (60 * LOAD_INTERVAL)
- #define WEIGHT1 (double) 0.9200444146293232 /* exp(-1/12) */
- #define WEIGHT2 (double) 0.9834714538216174 /* exp(-1/60) */
- #define WEIGHT3 (double) 0.9944598480048967 /* exp(-1/180) */
- d84 16
- d104 1
- d107 1
- d118 1
- a118 2
- extern int inputThreshold;
- extern double queueThreshold[];
- @
-
-
- 2.0
- log
- @Initial revision.
- @
- text
- @d8 3
- a12 4
- #ifndef lint
- static char rcsid[] = "$Header: loadAvg.c,v 1.8 87/03/11 11:09:50 douglis Exp $ SPRITE (Berkeley)";
- #endif not lint
-
- d41 1
- a41 1
- #define WRITE_INTERVAL (1 * LOAD_INTERVAL)
- d67 6
- d84 3
- a86 2
- int utils[LOAD_NUM_VALUES];
- double lengths[LOAD_NUM_VALUES];
- d89 1
- a100 1
- extern Boolean writeToStdOut;
- d109 2
- @
-